﻿using FluentNHibernate.Mapping;

namespace ContactCenter.AuditEventListener
{
    public class AuditInfoMap : ClassMap<AuditInfo>
    {
        public AuditInfoMap()
        {
            Table("AD_AuditInformation");

            Id(x => x.AuditEntryId, "AuditEntryId").GeneratedBy.HiLo("1000");

            Map(x => x.AuditDateTime, "AuditDateTime").Not.Nullable();
            Map(x => x.EntityName, "EntityName").Length(30).Not.Nullable();
            Map(x => x.FieldName, "FieldName").Length(30).Not.Nullable();
            Map(x => x.Username, "UserName").Length(20).Not.Nullable();
            Map(x => x.OldValue, "OldValue").Length(50);
            Map(x => x.NewValue, "NewValue").Length(50);
            Map(x => x.Action, "Action").CustomType<AuditActionType>();
        }
    }
}
